package week0401;

import java.util.Scanner;


public class Main4 {

	/**
	 * @param args
	 */
	private static Scanner sc;
	public static void main(String[] args) {
		sc = new Scanner(System.in);
	    int n;
	    n=sc.nextInt();
	    Object[] object=new Object[n];
	    String str;
	    String a;
	    for (int i = 0; i < n; i++) {
			str=sc.next();
			if(str.equals("c"))
				object[i]=new Computer();
			else if(str.equals("d"))
				object[i]=new Double(sc.nextDouble());
			else if(str.equals("i"))
				object[i]=new Integer(sc.nextInt());
			else if(str.equals("s")){
				a=sc.next();
				object[i]=a;
			}
			else object[i]=null;
		}
	    for (int i = object.length-1; i >=0 ; i--) {
	    	if(object[i]!=null)
			System.out.println(object[i]);
		}
	    sc.close();

	}

}
